package com.javatest.springboot3minio.entity;

import lombok.Getter;
import lombok.Setter;

/**
 * Created with IntelliJ IDEA. Description:
 *
 * @author liuzi
 * @since 2024/1/11 20:33
 */
@Getter
@Setter
public class AttachmentInfo {
  private int id;

  /** 附件名称 */
  private String attachmentName;

  /** 附件类型 */
  private String attachmentType;

  /** 项目编号 */
  private String projectId;

  public static AttachmentInfoBuilder builder() {
    return AttachmentInfoBuilder.create();
  }

  public static final class AttachmentInfoBuilder {
    private String attachmentName;
    private String attachmentType;
    private String projectId;

    private AttachmentInfoBuilder() {}

    static AttachmentInfoBuilder create() {
      return new AttachmentInfoBuilder();
    }

    public AttachmentInfoBuilder withAttachmentName(String attachmentName) {
      this.attachmentName = attachmentName;
      return this;
    }

    public AttachmentInfoBuilder withAttachmentType(String attachmentType) {
      this.attachmentType = attachmentType;
      return this;
    }

    public AttachmentInfoBuilder withProjectId(String projectId) {
      this.projectId = projectId;
      return this;
    }

    public AttachmentInfo build() {
      AttachmentInfo attachmentInfo = new AttachmentInfo();
      attachmentInfo.setAttachmentName(attachmentName);
      attachmentInfo.setAttachmentType(attachmentType);
      attachmentInfo.setProjectId(projectId);
      return attachmentInfo;
    }
  }
}
